@using System.Globalization

<div class="container my-5">
    <div class="row">
        <div class="col">
            <RadzenCard class="w-100 mb-4" >
                <RadzenCheckBox @bind-Value="@annotation" Name="annotation"></RadzenCheckBox>
                <RadzenLabel Text="Annotation" For="annotation" Style="margin-left: 8px; vertical-align: middle;" />
            </RadzenCard>
            <RadzenChart>
                <RadzenLineSeries Smooth="true" Data="@revenue2019" CategoryProperty="Date" Title="2019" ValueProperty="Revenue" RenderingOrder="1">
                    <RadzenSeriesAnnotation Visible="@annotation" TItem="DataItem" Data="@revenue2019[7]" OffsetY="-16" Text="Acquisition" />
                    <RadzenMarkers MarkerType="MarkerType.Circle" />
                </RadzenLineSeries>
                <RadzenCategoryAxis Padding="20" Formatter="@FormatAsMonth" />
                <RadzenValueAxis Formatter="@FormatAsUSD">
                    <RadzenGridLines Visible="true" />
                    <RadzenAxisTitle Text="Revenue in USD" />
                </RadzenValueAxis>
            </RadzenChart>
        </div>
    </div>
</div>

@code {
    bool annotation = true;

    class DataItem
    {
        public string Date { get; set; }
        public double Revenue { get; set; }
    }

    string FormatAsUSD(object value)
    {
        return ((double)value).ToString("C0", CultureInfo.CreateSpecificCulture("en-US"));
    }

    string FormatAsMonth(object value)
    {
        if (value != null)
        {
            return Convert.ToDateTime(value).ToString("MMM");
        }

        return string.Empty;
    }

    DataItem[] revenue2019 = new DataItem[] {
        new DataItem
        {
            Date = ("2019-01-01"),
            Revenue = 234000
        },
        new DataItem
        {
            Date = ("2019-02-01"),
            Revenue = 269000
        },
        new DataItem
        {
            Date = ("2019-03-01"),
            Revenue = 233000
        },
        new DataItem
        {
            Date = ("2019-04-01"),
            Revenue = 244000
        },
        new DataItem
        {
            Date = ("2019-05-01"),
            Revenue = 214000
        },
        new DataItem
        {
            Date = ("2019-06-01"),
            Revenue = 253000
        },
        new DataItem
        {
            Date = ("2019-07-01"),
            Revenue = 274000
        },
        new DataItem
        {
            Date = ("2019-08-01"),
            Revenue = 284000
        },
        new DataItem
        {
            Date = ("2019-09-01"),
            Revenue = 273000
        },
        new DataItem
        {
            Date = ("2019-10-01"),
            Revenue = 282000
        },
        new DataItem
        {
            Date = ("2019-11-01"),
            Revenue = 289000
        },
        new DataItem
        {
            Date = ("2019-12-01"),
            Revenue = 294000
        }
    };
}